import 'package:flutter/widgets.dart';
import 'package:full_display/common/qxp_color.dart';
import 'package:full_display/common/qxp_style.dart';
import 'package:full_display/unit/screen/screen_utility.dart';

class AreaItem extends StatelessWidget {
  final String title;
  final String code;
  final Function itemClick;

  const AreaItem(
      {Key? key,
      required this.title,
      required this.code,
      required this.itemClick})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () {
        itemClick.call();
      },
      child: Container(
        height: 56.0.H,
        padding: EdgeInsets.only(left: 20.0.W, right: 20.0.W),
        margin: EdgeInsets.only(bottom: 10.0.H, left: 20.0.W, right: 20.0.W),
        decoration: BoxDecoration(
            color: ColorPlate.white.withOpacity(0.05),
            borderRadius: BorderRadius.circular(12)),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Expanded(child: Container(
              alignment: Alignment.centerLeft,
              child: Text(
                title,
                style: StandardTextStyle.textWhite16Style,
              ),
            )),
            Container(
                width: 46.0.W,
                alignment: Alignment.centerLeft,
                child: Text(
                  '$code',
                  style: TextStyle(
                    fontSize: 16.0.SP,
                    color: ColorPlate.white.withOpacity(0.55),
                  ),
                ))
          ],
        ),
      ),
    );
  }
}
